import 'dart:typed_data';

import 'package:shortmovieapp/data/requestData.dart';
import 'package:shortmovieapp/data/viewData.dart';
import 'package:shortmovieapp/http/core/HttpRequest.dart';
import 'package:shortmovieapp/http/core/app_http_request.dart';

class getRecommendedMoviesRequest extends AppHttpRequest {
  @override
  HttpMethod get method => HttpMethod.Get;

  @override
  String get relativePath => "Movies/get_recommended_movies";

  getRecommendedMoviesRequest(MovieType movieType, int num) {
    addParam("movieType", movieType.toString());
    addParam("num", num);
  }
}
class checkMovieNameExist extends AppHttpRequest {
  @override
  HttpMethod get method => HttpMethod.Get;

  @override
  String get relativePath => "Movies/check_movie_name_exist";

  getRecommendedMoviesRequest(String name) {
    addParam("movieName", name);
  }
}
class createMovieRequest extends AppHttpRequest {
  @override
  HttpMethod get method => HttpMethod.Post;

  @override
  String get relativePath => "Movies/create_movie";

  createMovieRequest(MovieProto movie) {
    addParam("name", movie.name);
    addParam("totoalEpisodeCount", movie.totoalEpisodeCount);
    addParam("sub_genre", movie.sub_genre);
    addParam("description", movie.description);
    addParam("author", movie.author);
    addParam("uploader", movie.uploader);
    addParam("publishDate", movie.publishDate);
    //addParam("icon", movie.icon);
  }
}

// class upploadMovieCover extends AppHttpRequest {
//   @override
//   HttpMethod get method => HttpMethod.Post;

//   @override
//   String get relativePath => "Movies/upload_movie_cover";

//   upploadMovieCover(int movieId,String movieName) {
//     addParam("movieId", movieId);
//     addParam("movieName",movieName);
//   }
// }

class getMovieDataRequest extends AppHttpRequest {
  @override
  HttpMethod get method => HttpMethod.Get;

  @override
  String get relativePath => "Movies/get_movie";

  getMovieDataRequest(String movieName) {
    addParam("movieName", movieName);
  }
}

class uploadVideoRequest extends AppHttpRequest {
  @override
  HttpMethod get method => HttpMethod.Post;

  @override
  String get relativePath => "Movies/upload_video";

  uploadVideoRequest(VideoProto movie) {
    addParam("movieId", movie.movieId);
    addParam("movieName", movie.movieName);
    addParam("episodeId", movie.episodeId);
    addParam("episodeName", movie.episodeName);
    //addParam("icon", movie.icon);
  }
}
